home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d14 / cmdp70s.arc / CMDPOST.CP$ < prev    next >
Text File  |  1991-03-09  |  23KB  |  624 lines

  1. ; Define addon menu   USER menus should go into CMDUSER.CPM...by convention...
  2. #NextFile CMDUSER.CPM
  3.  
  4.  
  5. ; CmdPost menu    initialization code
  6.  
  7.         ; Initialize a few variables here. 
  8.       
  9.         a=Version()
  10.         CP="CmdPost"
  11.         CPDIR=DirHome()
  12.  
  13.         ; *******TO CHANGE TITLES, USE THE Main.ResetOptions command - automagic now!
  14.         TitleFirst=iniread(CP,"TitleFirst","Command Post - Window 1")
  15.         TitleSecond=iniread(CP,"TitleSecond","Command Post - Window 2")
  16.         if !IsLicensed() then TitleFirst="Command Post %a% - Eval Only"
  17.         if !IsLicensed() then TitleSecond ="Command Post %a% # Eval Only"
  18.         crlf=strcat(num2char(13),num2char(10))
  19.         tab=num2char(9)
  20.  
  21. ; Setting up the View menu item here.
  22.  
  23.         ViewShortLong=iniread(CP,"ViewShortLong","SHORT")
  24.  
  25.         if ViewShortLong=="SHORT" then MenuChange("ViewShort",@CHECK)
  26.         if ViewShortLong=="LONG" then MenuChange("ViewLong",@CHECK)
  27.         
  28.         ViewBy=iniread(CP,"ViewBy","NAME")
  29.         if ViewBy=="NAME" then MenuChange("ViewByName",@CHECK)
  30.         if ViewBy=="DATE" then MenuChange("ViewByDate",@CHECK)
  31.         if ViewBy=="SIZE" then MenuChange("ViewBySize",@CHECK)
  32.         if ViewBy=="KIND" then MenuChange("ViewByKind",@CHECK)
  33.         if ViewBy=="UNSORTED" then MenuChange("ViewUnsorted",@CHECK)
  34.  
  35.         ViewWhat=iniread(CP,"ViewWhat","ALL")
  36.         if ViewWhat=="ALL" then MenuChange("ViewAll",@CHECK)
  37.         if ViewWhat=="PARTIAL" then MenuChange("ViewPartial",@CHECK)
  38.         if ViewWhat=="PROGRAMS" then MenuChange("ViewPrograms",@CHECK)
  39.  
  40.         SD3="*.*"
  41.         if ViewWhat=="PROGRAMS" then SD3="*.EXE *.COM *.BAT *.PIF"
  42.         if ViewWhat=="PARTIAL" then SD3=iniread(CP,"Partial","*.*")
  43.         SetDisplay(ViewShortLong,ViewBy,SD3)
  44.         drop(a,ViewShortLong,ViewBy,ViewWhat,SD3)
  45.  
  46. ; Setup Print menu item...Kill it if no text printer
  47.         MenuChange("FilePrint", (IniRead(CP,"TextPrinter","")=="NONE") *@DISABLE)
  48. ; Setup Screen Blank Time.  Get time from win.ini
  49.         a=iniread(CP,"BlankTime",5)
  50.         if a!=9999 then run("%CPDIR%cp_blnk.exe",a)
  51. ;                             ;    <0....blanking with no clock
  52. ;                             ;     0... no blanking, but have a clock
  53. ;                             ;    >0... blanking and clock
  54. ;                             ;    9999  Don't even run it.
  55. ;                             ;    multiple startups ignored.
  56.  
  57.  
  58.         if IsRunning() then goto MORETHANONE   ;More than one CP running
  59.         WinTitle("",TitleFirst);Title of first 'Post
  60.         a=IniRead(CP,"WinPosition","0,0,1000,@ABOVEICONS")
  61.         WinPlace(%a%,"")
  62.         Exit
  63.  
  64.         :MORETHANONE
  65.         TitleTemp=TitleSecond
  66.         if !WinExist(TitleFirst) then TitleTemp=TitleFirst
  67.         WinTitle("",TitleTemp)      ;Title of this 'Post
  68.         WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
  69.         WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  70.  
  71.         ;Do not Drop TitleFirst,TitleSecond,crlf,tab,CP as these are used
  72.         ;in following menu items.
  73.         Drop(a,TitleTemp)
  74.  
  75. ; And the main menu starts.  
  76. &File
  77.  &Run...
  78.         r=CurrentFile()
  79.         if !IsKeyDown(@SHIFT) then r=askline("RUN","Enter file to run",r)
  80.         r=strcat(strtrim(r)," ")
  81.         i=strindex(r," ",0,@FWDSCAN)
  82.         a=strsub(r,1,i-1)
  83.         b=strtrim(strsub(r,i,strlen(r)-i+1))
  84.         run("%a%","%b%")
  85.         drop(a,b,r,i)        
  86.  &Load...
  87.         r=CurrentFile()
  88.         if !IsKeyDown(@SHIFT) then l=askline("LOAD","Enter file to load",CurrentFile())
  89.         l=strcat(strtrim(l)," ")
  90.         i=strindex(l," ",0,@FWDSCAN)
  91.         a=strsub(r,1,i-1)
  92.         b=strtrim(strsub(r,i,strlen(r)-i+1))
  93.         runicon("%a%","%b%")
  94.         drop(a,b,i,l)
  95.  Bro&wse...
  96.         l=CurrentFile()
  97.         if !IsKeyDown(@SHIFT) then l=askline("Browse","Enter file to browse",l)
  98.         run("%CPDIR%browser.exe",l)
  99.         drop(a,l)
  100.  &Edit...
  101.         b=FileLocate("winedit.exe")
  102.         if b=="" then b="notepad.exe"
  103.         l=CurrentFile()
  104.         if !IsKeyDown(@SHIFT) then l=askline("Edit","Enter file to edit",l)
  105.         if l=="" || l==" " then goto NULL
  106.         a=strscan(l,".\",0,@BACKSCAN)
  107.         if a==0 then l=strcat(l,".")
  108.         if a==0 then goto NULL
  109.         if strsub(l,a,1)!="." then l=strcat(l,".")
  110.      :NULL
  111.         run(b,l)
  112.         drop(a,b,l)
  113.  &Copy... \ {F8}
  114.         r=OtherDir()
  115.         s=strcat(DirItemize("")," ",FileItemize(""))
  116.         terminate(strlen(s)==1,"Copy Error","No files selected")
  117.         if !IsKeyDown(@SHIFT) then r=askline("Copy",StrCat(s,crlf,crlf,"to"),r)
  118.         terminate(r=="","Copy Error","Cannot copy to null file name")        
  119.         q=strindex(r,"\",0,@FWDSCAN) ; Directory Name in there??
  120.         if q==0 then SetDisplay("","","") ;Nope. Set flag to update directory
  121.         FileCopy(s,r,@TRUE)
  122.         OtherUpdate()
  123.         drop(r,s,q)
  124.  &Move/Rename...  \  {F7}
  125.         r=OtherDir()
  126.         s=strcat(DirItemize("")," ",FileItemize(""))
  127.         terminate(strlen(s)==1,"Move Error","No files selected")
  128.         if !IsKeyDown(@SHIFT) then r=askline("Move",StrCat(s,crlf,crlf,"to"),r)
  129.         terminate(r=="","Move Error","Cannot move to null file name")
  130.         SetDisplay("","","") ;Set flag to update directory
  131.         FileMove(s,r,@TRUE)
  132.         OtherUpdate()
  133.         drop(r,s)
  134.  &Delete File... \ {DEL}
  135.         f=FileItemize("")
  136.         g=DirItemize("")
  137.         b=0
  138.         if strlen(g)!=0 then b=AskYesNo("!!! Warning !!! ",strcat("Delete files from these directories too?",crlf,g))
  139.         if b!=0 then f=strcat(g," ",f)
  140.         terminate(strlen(f)==0,"delete","No files specified")
  141.         if !IsKeyDown(@SHIFT) then if askyesno("Delete",f)==@NO then exit
  142.         SetDisplay("","","") ;Set flag to update directory
  143.         FileDelete(f)
  144.         OtherUpdate()  ; Well if the "other" CmdPost Window points to the
  145.                     ; same directory, it *IS* nice...
  146.         drop(f,g,b)
  147.  
  148.  &Print...
  149.         s=FileItemize("")
  150.         terminate(strlen(s)==0,"Print Error","No files selected")
  151.         TextPrinter=iniread(CP,"TextPrinter","ASK")
  152.         if TextPrinter!="ASK" then goto NOASK1
  153.         r=AskYesNo("Attention",strcat("This print routine only works with standard printers.",crlf,"Do you have a standard (NON-Postscript) printer?"))
  154.         if r==@YES then goto ASK1
  155.         iniwrite(CP,"TextPrinter","NONE")
  156.         MenuChange("FilePrint",@DISABLE)
  157.         Exit
  158.         :ASK1
  159.         TextPrinter="NONE|LPT1|LPT2|LPT3"
  160.         TextPrinter=ItemSelect("Choose the STD text printer",TextPrinter,"|")
  161.         terminate(strlen(TextPrinter)==0,"Error","Nothing chosen")
  162.         iniwrite(CP,"TextPrinter",TextPrinter)
  163.         :NOASK1
  164.         Terminate(TextPrinter=="NONE","ERROR","No Text Printers on system")
  165.         a=AskLine("Print",strcat(s,crlf,crlf,"to"),TextPrinter)
  166.         FileCopy(s,a,@FALSE)
  167.  _&Hilite Files
  168.         a=AskLine("Hilite Files","Enter types of files to hilite",strcat("*.",FileExtension(CurrentFile())))
  169.         FileHilite(a,@TRUE)
  170.  &Unhilite Files
  171.         a=AskLine("Unhilite Files","Enter types of files to unhilite",strcat("*.",FileExtension(CurrentFile())))
  172.         FileHilite(a,@FALSE)
  173.  _&Size of selected files
  174.         message("Total size of files",strcat(FileSize(FileItemize(""))," Bytes"))
  175.  
  176.  &Freespace on Drives   
  177. ;        This code initially asks for your last drive
  178. ;        (It does assume you have no holes between C and the
  179. ;         last drive...)
  180. ;        and then computes disk space based on the last drive
  181.  
  182.         NextDrive="C"    ;ASSUMES C is your first hard drive.
  183.         TotalSize=0
  184.         DriveReport=""
  185.         LastDrive=iniread(CP,"LastDrive","ASK")
  186.         if LastDrive!="ASK" then goto COUNTSPACE
  187.         LastDrive=AskLine("Setup Question",strcat("Enter letter of last (contiguous) disk drive",crlf,"C D E F G H ...Z"),"C")
  188.         LastDrive=StrUpper(LastDrive)
  189.         iniwrite(CP,"LastDrive",LastDrive)
  190.  
  191.         :COUNTSPACE
  192.         ; Always do C drive
  193.         a=DiskFree(NextDrive)/1024
  194.         TotalSize=a+TotalSize
  195.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  196.         NextDrive=num2char(char2num(NextDrive)+1)
  197.         if NextDrive<=LastDrive then goto COUNTSPACE
  198.  
  199.         ItemSelect("Total Space = %TotalSize%K",DriveReport,"@")
  200.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  201.  
  202.  Space on &A and size of files
  203.         message(strcat("Drive A ",DiskFree("A")),strcat("Selected Files ",FileSize(FileItemize(""))))
  204.  
  205.  
  206.  Space on &B and size of files
  207.         message(strcat("Drive B ",DiskFree("B")),strcat("Selected Files ",FileSize(FileItemize(""))))
  208.  
  209.  
  210.  _&Extensions...
  211.         a=strtrim(CurrentFile())
  212.         i=strindex(a,".",0,@FWDSCAN)
  213.         terminate(i==0,"Association Error","Associated files must have an extension")
  214.         b=FileExtension(a)
  215.         c=iniread("extensions",b,"???.EXE ^.%b%")
  216.         d=askline("Associate","%b% files are associated with",c)
  217.         terminate(c==d,"","")
  218.         iniwrite("extensions",b,d)
  219.  _E&xit Windows \ ^X
  220.         EndSession()
  221.         
  222. &Dir
  223.  Crea&te Directory...
  224.         a=askline("Create Directory","Enter directory to create","")
  225.         terminate(a=="","Create Error","Cannot create directory with null name")
  226.         DirMake(a)
  227.         SetDisplay("","","")
  228.         drop(a)
  229.  
  230.  &Rename Directory...
  231.         a=DirItemize("")
  232.         terminate(ItemCount(a," ")!=1,"Rename Error","Zero or more than one dir specified")
  233.         b=AskLine("Rename Directory","Enter new directory name for %a%",a)
  234.         terminate(a==b || b=="","Rename Error","Illegal name change specified")
  235.         DirRename(a,b)
  236.         SetDisplay("","","")
  237.         OtherUpdate()
  238.         drop(a,b)
  239.  
  240.  &Delete Directory...
  241.         f=DirItemize("")
  242.         terminate(strlen(f)==0,"Delete Directory","No directory specified")
  243.         terminate(@no==askyesno("Delete Directory",f),"Delete Directory","Directory not deleted")
  244.         DirRemove(f)
  245.         SetDisplay("","","")
  246.         OtherUpdate()   ; Well if the "other" CmdPost Window points to the
  247.                       ; same directory, it *is* nice
  248.         drop(f)
  249.  
  250.  &Change Directory...
  251.         a=DirGet()
  252.         b=strindex(a,':',1,@fwdscan)
  253.         c=askline("Change Directory","Enter directory name",strsub(a,b+1,strlen(a)-b-1))
  254.         terminate(c=="","Directory Error","Directory with null name does not exist")
  255.         DirChange(c)
  256.         SetDisplay("","","")
  257.         drop(a,b,c)
  258.  
  259.  _&Format Diskette...
  260.         ; A wonderful example of variable substitution
  261.         D1="1) 5.25 High Density (1.2M)"
  262.         D2="2) 5.25 Standard (360K)"
  263.         D3="3) 3.5  High Density (1.44M)"
  264.         D4="4) 3.5  Standard (720K)"
  265.         D0="0) None"
  266.         DriveA=iniread(CP,"DriveA","ASK")
  267.         DriveB=iniread(CP,"DriveB","ASK")
  268.         if DriveA!="ASK" & DriveB!="ASK" then goto DOFORMAT
  269.  
  270.         DC="%D1%|%D2%|%D3%|%D4%|%D0%"
  271.         Message("Attention","Command Post needs to learn what kind of floppies %crlf% the system has.  Please select accordingly.")
  272.         :ASKA
  273.         a=ItemSelect("Select type of Drive A",DC,"|")
  274.         if a!="" then goto OKDRIVEA
  275.         Message("You MUST select an option for A.","Please retry")
  276.         goto ASKA
  277.         :OKDRIVEA
  278.         DriveA=strsub(a,1,1)
  279.         iniwrite(CP,"DriveA",DriveA)
  280.  
  281.         :ASKB
  282.         a=ItemSelect("Select type of Drive B",DC,"|")
  283.         if a!="" then goto OKDRIVEB
  284.         Message("You MUST select an option for B.","Please retry")
  285.         goto ASKB
  286.         :OKDRIVEB
  287.         DriveB=strsub(a,1,1)
  288.         iniwrite(CP,"DriveB",DriveB)
  289.  
  290.         :DOFORMAT
  291.         A0=""
  292.         A1="1)    A:   5.25 HD (1.2M)|2)    A:   5.25 DD (360K)"
  293.         A2="2)    A:   5.25 DD (360K)"
  294.         A3="3)    A:   3.5 HD (1.44M)|4)    A:   3.5 Std (720K)"
  295.         A4="4)    A:   3.5 Standard (720K)"
  296.         B0=""
  297.         B1="5)    B:   5.25 HD (1.2M)|6)    B:   5.25 DD (360K)"
  298.         B2="6)    B:   5.25 Standard (360K)"
  299.         B3="7)    B:   3.5 HD (1.44M)|8)    B:   3.5 DD (720K)"
  300.         B4="8)    B:   3.5 DD (720K)"
  301.         FF=strcat(A%DriveA%,"|",B%DriveB%)
  302.         drop(A0,A1,A2,A3,A4,B0,B1,B2,B3,B4)
  303.  
  304.         FF=ItemSelect("Choose Format Type Desired",FF,"|")
  305.         terminate(FF=="","Format","No parameters selected")
  306.  
  307.         FF=strsub(FF,1,1)   ; FF will be 1 thru 8 (with luck)
  308.         DR=strsub("AB",(FF>4)+1,1)  ; DR is desired drive
  309.         FF=FF-((FF>4)*4)            ; FF is 1 thru 4
  310.         F11=""
  311.         F12="/4"
  312.         F22=""
  313.         F33=""
  314.         F34="/n:9 /t:80"
  315.         F44=""
  316.         DC=Drive%DR%   ; get drive type
  317.         FC=F%DC%%FF%
  318.         FC="%DR%:  %FC%"
  319.         DC=strsub(D%FF%,4,strlen(d%FF%)-3)
  320.         Pause("Attention",strcat("Preparing to format %DC%",crlf,"diskette in Drive %DR% with command:",crlf,"FORMAT %FC%"))
  321.         run("command.com","/c format.com %FC%")
  322.         drop(D0,D1,D2,D3,D4,DC,xxx,DriveA,DriveB)
  323.         drop(FF,DR,F11,F12,F22,F33,F34,F44,DC,FC)
  324.  
  325.  _Directory &Tree
  326.         run("%CPDIR%cp_tree.exe","")
  327.  
  328.  
  329.  
  330. &View
  331.  &Short
  332.         SetDisplay("SHORT","","")
  333.         MenuChange("ViewShort",@CHECK)
  334.         MenuChange("ViewLong",@UNCHECK)
  335.         iniwrite(CP,"ViewShortLong","SHORT")
  336.  &Long
  337.         SetDisplay("LONG","","")
  338.         MenuChange("ViewShort",@UNCHECK)
  339.         MenuChange("ViewLong",@CHECK)
  340.         iniwrite(CP,"ViewShortLong","LONG")
  341.  _&All
  342.         SetDisplay("","","*.*")
  343.         MenuChange("ViewAll",@CHECK)
  344.         MenuChange("ViewPartial",@UNCHECK)
  345.         MenuChange("ViewPrograms",@UNCHECK)
  346.         iniwrite(CP,"ViewWhat","ALL")
  347.  &Partial...
  348.         a=iniread(CP,"Partial","*.*")
  349.         a=AskLine("View Partial","Enter types of files desired",a)
  350.         iniwrite(CP,"Partial",a)
  351.         SetDisplay("","",a)
  352.         MenuChange("ViewAll",@UNCHECK)
  353.         MenuChange("ViewPartial",@CHECK)
  354.         MenuChange("ViewPrograms",@UNCHECK)
  355.         iniwrite(CP,"ViewWhat","PARTIAL")
  356.  P&rograms
  357.         SetDisplay("","","*.EXE *.COM *.BAT *.PIF")
  358.         MenuChange("ViewAll",@UNCHECK)
  359.         MenuChange("ViewPartial",@UNCHECK)
  360.         MenuChange("ViewPrograms",@CHECK)
  361.         iniwrite(CP,"ViewWhat","PROGRAMS")
  362.  _By &Name
  363.         SetDisplay("","NAME","")
  364.         MenuChange("ViewByName",@CHECK)
  365.         MenuChange("ViewByDate",@UNCHECK)
  366.         MenuChange("ViewBySize",@UNCHECK)
  367.         MenuChange("ViewByKind",@UNCHECK)
  368.         MenuChange("ViewUnsorted",@UNCHECK)
  369.         iniwrite(CP,"ViewBy","NAME")
  370.  By &Date
  371.         SetDisplay("","DATE","")
  372.         MenuChange("ViewByName",@UNCHECK)
  373.         MenuChange("ViewByDate",@CHECK)
  374.         MenuChange("ViewBySize",@UNCHECK)
  375.         MenuChange("ViewByKind",@UNCHECK)
  376.         MenuChange("ViewUnsorted",@UNCHECK)
  377.         iniwrite(CP,"ViewBy","DATE")
  378.  By Si&ze
  379.         SetDisplay("","SIZE","")
  380.         MenuChange("ViewByName",@UNCHECK)
  381.         MenuChange("ViewByDate",@UNCHECK)
  382.         MenuChange("ViewBySize",@CHECK)
  383.         MenuChange("ViewByKind",@UNCHECK)
  384.         MenuChange("ViewUnsorted",@UNCHECK)
  385.         iniwrite(CP,"ViewBy","SIZE")
  386.  By &Kind       
  387.         SetDisplay("","KIND","")
  388.         MenuChange("ViewByName",@UNCHECK)
  389.         MenuChange("ViewByDate",@UNCHECK)
  390.         MenuChange("ViewBySize",@UNCHECK)
  391.         MenuChange("ViewByKind",@CHECK)
  392.         MenuChange("ViewUnsorted",@UNCHECK)
  393.         iniwrite(CP,"ViewBy","KIND")
  394.  &Unsorted
  395.         SetDisplay("","UNSORTED","")
  396.         MenuChange("ViewByName",@UNCHECK)
  397.         MenuChange("ViewByDate",@UNCHECK)
  398.         MenuChange("ViewBySize",@UNCHECK)
  399.         MenuChange("ViewByKind",@UNCHECK)
  400.         MenuChange("ViewUnsorted",@CHECK)
  401.         iniwrite(CP,"ViewBy","UNSORTED")
  402.  
  403.  |&1 Stack
  404.         winarrange(1)
  405.  &2 Arrange
  406.         winarrange(2)
  407.  &3 Arrange in Rows
  408.         winarrange(3)
  409.  &4 Arrange in Columns
  410.         winarrange(4)
  411.  _&5 (w/o CP) Stack
  412.         winiconize("")
  413.         winarrange(1)
  414.  &6 (w/o CP) Arrange
  415.         winiconize("")
  416.         winarrange(2)
  417.  &7 (w/o CP) Arrange in Rows
  418.         winiconize("")
  419.         winarrange(3)
  420.  &8 (w/o CP) Arrange in Cols
  421.         winiconize("")
  422.         winarrange(4)
  423.  _Change &Wallpaper
  424.            DirChange(FilePath(FileLocate("WIN.INI")))
  425.            a=FileItemize("*.BMP")
  426.            a=strcat("-None- ",a)
  427.            a=ItemSelect("Select New Wallpaper",a," ")
  428.            terminate(a=="","Wallpaper","No wallpaper selected")
  429.            if a=="-None-" then Wallpaper("",0)
  430.            if a=="-None-" then exit
  431.            tile=@FALSE
  432.            if FileSize(a)<40000 then tile=@TRUE  
  433.            ;if bmp size less than 40K, assume tile, else center
  434.            Wallpaper(a,tile)
  435.            drop(a,tile)
  436.  
  437.  
  438. &Main
  439.  &Command Post (2nd Window)
  440.         ErrorMode(@OFF)
  441.         a=WinActivate(TitleFirst)
  442.         b=WinActivate(TitleSecond)
  443.         ErrorMode(@CANCEL)
  444.         if (a&b) then goto PLACETHEM
  445.         DirChange(CPDIR)
  446.         run("cmdpost.exe","")
  447.         drop(a,b)
  448.         Exit
  449.         :PLACETHEM
  450.         WinPlace(0,0,500,@ABOVEICONS,TitleFirst)
  451.         WinPlace(500,0,1000,@ABOVEICONS,TitleSecond)
  452.         drop(a,b)
  453.  
  454.  
  455.  Control &Panel
  456.         errormode(@off)
  457.         terminate(winactivate("Control Panel"),"","")
  458.         errormode(@cancel)
  459.         run("control.exe","")
  460.  
  461.  C&lipboard
  462.         errormode(@off)
  463.         terminate(winactivate("Clipboard"),"","") ;Already Running
  464.         errormode(@cancel)
  465.         run("Clipbrd.exe","")
  466.  
  467.  &DOS Prompt
  468.         run(Environment("COMSPEC"),"")
  469.  
  470.  _Get &Help Cardfile
  471.            run("cardfile.exe","%CPDIR%cp_help.crd")
  472.  Get &Question 'n' Answer Cardfile
  473.            run("cardfile.exe","%CPDIR%cp_quest.crd")
  474.  
  475.  Reset &Options...
  476.         :NEXTOPTION
  477.         a="Blanker Options|Window Position|Printer Reset|Floppy Reset|Hard Drive Reset|Window Titles"
  478.         a=ItemSelect("Choose Option to Reset",a,"|")
  479.         if a=="Blanker Options" then goto BLANKER
  480.         if a=="Window Position" then goto POSITION
  481.         if a=="Printer Reset" then goto INFORESET
  482.         if a=="Floppy Reset" then goto INFORESET
  483.         if a=="Hard Drive Reset" then goto INFORESET
  484.         if a=="Window Titles" then goto WINTITLES
  485.         Exit
  486.  
  487.         :BLANKER
  488.         a=iniread(CP,"BlankTime",5)
  489.         b1="Enter screen blanker delay time"
  490.         b2="or 0 to disable blanker"
  491.         b3="or negative time to disable clock"
  492.         b4="or 9999 to eliminate it altogether"
  493.         b1=strcat(b1,crlf,b2,crlf,b3,crlf,b4)
  494.         a=AskLine("Screen Blanker",b1,iniread(CP,"BlankTime",5))
  495.         iniwrite(CP,"BlankTime",a)
  496.         ErrorMode(@OFF)
  497.         WinClose("CmdPost Clock")
  498.         ErrorMode(@CANCEL)
  499.         if a!=9999 then run("%CPDIR%CP_BLNK.EXE",a)
  500.         goto NEXTOPTION
  501.  
  502.         :POSITION
  503.         b1="Do you wish to save the current CmdPost"
  504.         b2="window position for future startups?"
  505.         b1=strcat(b1,crlf,b2)
  506.         a=AskYesNo("CmdPost Window Position",b1)
  507.         if a==@YES then IniWrite(CP,"WinPosition",WinPosition(""))
  508.         goto NEXTOPTION
  509.  
  510.         :INFORESET
  511.         if a!="Printer Reset" then goto INFORESET2
  512.         iniwrite(CP,"TextPrinter","ASK")
  513.         MenuChange("FilePrint",@ENABLE)
  514.         Goto INFORESET9
  515.  
  516.         :INFORESET2
  517.         if a!="Hard Drive Reset" then goto INFORESET3
  518.         iniwrite(CP,"LastDrive","ASK")
  519.         Goto INFORESET9
  520.         :INFORESET3
  521.  
  522.         iniwrite(CP,"DriveA","ASK")
  523.         iniwrite(CP,"DriveB","ASK")
  524.         
  525.         :INFORESET9
  526.         b1="CmdPost's saved information reset."
  527.         b2="You will be prompted to re-enter the"
  528.         b3="necessary information when it is required."
  529.         b1=strcat(b1,crlf,b2,crlf,b3)
  530.         Message("Information Reset",b1)
  531.         goto NEXTOPTION
  532.  
  533.         :WINTITLES
  534.         b1=AskLine("First CmdPost Title","Enter name of main CmdPost window.%crlf%Must be licensed  for this to work.",TitleFirst)
  535.         b2=AskLine("Second CmdPost Title","Enter name of other window.%crlf%Must be different!",TitleSecond)
  536.         if (StrIndex(b1,b2,0,@FWDSCAN)+StrIndex(b2,b1,0,@FWDSCAN))==0 then goto TITLEOK
  537.         Message("WinTitle","The two titles MUST be completely different.")
  538.         goto WINTITLES
  539.         :TITLEOK
  540.         iniwrite(CP,"TitleFirst",b1)
  541.         iniwrite(CP,"TitleSecond",b2)
  542.         if WinExist(TitleFirst) then WinTitle(TitleFirst,b1)
  543.         if WinExist(TitleSecond) then WinTitle(TitleSecond,b2)
  544.         TitleFirst=b1
  545.         TitleSecond=b2
  546.         drop(b1,b2,b3)
  547.         goto NEXTOPTION
  548.  
  549.            
  550.  _&System Information
  551.         run("%CPDIR%cp_info.exe","")
  552.  
  553.  |P&rogram Manager
  554.         errormode(@off)
  555.         terminate(winactivate("Program Manager"),"","") ;Already Running
  556.         errormode(@cancel)
  557.         run("Progman.exe","")
  558.  
  559.  &File Manager
  560.         errormode(@off)
  561.         terminate(winactivate("File Manager"),"","") ;Already Running
  562.         errormode(@cancel)
  563.         run("winfile.exe","")
  564.  
  565.  Print &Manager
  566.         run("printman.exe","")   ; takes care of itself
  567.  
  568.  &Windows Setup
  569.         a=FilePath(Filelocate("system.ini"))
  570.         run(strcat(a,"setup.exe"),"")
  571.         drop(a)
  572.  
  573.  
  574.  _&Edit CmdPost menus
  575.            DirChange(FilePath(FileLocate("%CPDIR%CMDPOST.CPM")))
  576.            a=FileItemize("*.CPM")
  577.            a=ItemSelect("Select menu to edit",a," ")
  578.            terminate(a=="","Edit","No file selected")
  579.            ;it it already running???  Find it...
  580.            ErrorMode(@OFF)
  581.            terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  582.            bak=strcat(FileRoot(a),".BAK")
  583.            FileCopy(a,bak,@FALSE)
  584.            run("notepad.exe",a)
  585.            drop(a,bak)
  586.  
  587.  Edit &INI files
  588.            DirChange(FilePath(FileLocate("WIN.INI")))
  589.            a=FileItemize("*.INI")
  590.            a=ItemSelect("Select INI file to edit",a," ")
  591.            terminate(a=="","Edit","No file selected")
  592.            drop(NotWin2,b)
  593.            ;it it already running???  Find it...
  594.            ErrorMode(@OFF)
  595.            terminate(WinActivate("Notepad - %a%"),"","") ;Already being edited
  596.            bak=strcat( FileRoot(a),".BAK")
  597.            FileCopy(a,bak,@FALSE);
  598.            run("notepad.exe",a)
  599.            drop(a,bak)
  600.  
  601.  Edit System Confi&guration
  602.            run("sysedit.exe","")  ;takes care of itself
  603.  
  604.  PIF Edi&t...
  605.         a=strupper(FileExtension(CurrentFile()))
  606.         if a!="PIF" then goto PIF2
  607.         run("pifedit.exe",CurrentFile())
  608.         exit
  609.         :PIF2
  610.         if IsKeyDown(@SHIFT)==@NO then goto GENERICPIF
  611.         a=FileItemize("*.PIF")
  612.         a=ItemSelect("Choose a PIF File to edit",a," ")
  613.         run("pifedit.exe",a)
  614.         exit
  615.         :GENERICPIF
  616.         DirChange(FilePath(FileLocate("_default.pif")))
  617.         run("pifedit.exe","")
  618.         drop(a,b)
  619.  
  620.  
  621.  
  622.  
  623.     
  624.